<!DOCTYPE html>
<html lang="en"  ng-app="infoModule">
<head>
    <meta charset="UTF-8">
    <title>锦湖日丽</title>
    <link rel="icon" type="image/x-icon" href="images/xlogo.png"/>
    <link rel="stylesheet" type="text/css" href="../css/index.css">
    <link rel="stylesheet" type="text/css" href="../css/listDetail.css">
    <script type="text/javascript" src="/Portal/Mobile/form/jquery-2.1.3.min.js"></script>
    <script src="/Portal/vendor/angular/angular.js"></script>
    <script src="/Portal/vendor/angular/angular-sanitize/angular-sanitize.js"></script>
    <style>
        .tdLeft{
            text-align: right;
            vertical-align: top;
        }
        .tdRight{
            text-align: left;
            padding-left: 20px;
            vertical-align: top;
        }
        .tdRight a{
            font-size: 14px;
            color:#18B4FE;
        }
        .dynamic-content{
            min-height:0px;
        }
    </style>
    <script type="text/javascript">
        var infoModule = angular.module('infoModule',['ngSanitize']);
        infoModule.controller('infoCtrl',  function($scope, $http,$interval,$sce){

            $scope.init = function() {
                /**
                 * 先校验登陆状态，成功则加载内容
                 */
                $http({
                    method : 'GET',
                    url : "/Portal/Organization/GetCurrentUser",
                }).success(function(result) {
                    if(result.Success) {
                        $scope.CurrentUser = result.User;
                        $scope.DepartName = result.OUDepartName;
                    } else {

                    }
                });

                var urlPamars = parseUrl();

                $scope.objectId =  urlPamars["ObjectId"];
                $scope.LoadDataInfo();
            };



            //加载详情
            $scope.LoadDataInfo = function(){
                $http({
                    method:'GET',
                    url:'/Portal/kumhosunny/gateway/LoadDataInfo',
                    params : {
                        "objectId" : $scope.objectId
                    }
                }).success(function(result){
                    if(result.Success) {
                        $scope.info = result.Extend.mainData[0];
                        $scope.attach = result.Extend.attach;
                        $scope.info.content = $sce.trustAsHtml($scope.info.content);
                        console.log($scope.info);
                    } else {

                    }
                });
            };
            $scope.init();
        })


        //解析url参数
        function parseUrl(){
            var url = location.href;
            var i = url.indexOf('?');
            if(i == -1) {
                return;
            }
            var querystr = url.substr(i+1);
            var arr1 = querystr.split('&');
            var arr2 = new Object();
            for(i in arr1) {
                var ta = arr1[i].split('=');
                arr2[ta[0]] = ta[1];
            }
            return arr2;
        }

    </script>


</head>
<body ng-controller="infoCtrl">
<div id="wrapper">
    <!--//头部开始-->

    <div class="header-nav">
    </div>
    <!--导航结束-->
    <!--小标题条star-->
    <div class="news-headline">
        <a class="margin-left-20" href="../index.html"><img src="../images/zhuye.png" class="img-sy">首页</a>
        <span> > </span>
        <a ng-href="list.html">通知公告</a>
        <span> > </span>
        <a>公告详情</a>
    </div>
    <!--end-->

    <div class="dynamic-title">
        <div class="dynamic-big" >
            <span ng-bind="info.title"></span>
        </div>
        <div class="tilte-dynamic" >
            <span class="margin-right-8">发布人: {{info.OriginatorName}}</span>
            <span class="margin-right-8">发布时间: {{info.FinishTime | limitTo : 16}}</span>
            <!-- <span class="margin-right-8" ng-if="info.NewsSource">新闻来源: {{info.NewsSource}}</span>
             <span class="margin-right-8">修改时间：{{info.CREATEDTIME.split('.')[0]}}</span> -->
        </div>
        <div class="dynamic-content" ng-bind-html="info.content">
        </div>


        <div class="dynamic-content" ng-if="attach !=''">
            <table>
                <tr>
                    <td class="tdLeft">附件列表</td>
                    <td class="tdRight">
                        <div ng-repeat="att in attach">
                            <a href="/Portal/ReadAttachment/Read?BizObjectSchemaCode={{att.BIZOBJECTSCHEMACODE}}&BizObjectID={{att.BIZOBJECTID}}&AttachmentID={{att.AttachmentId}}&OpenMethod=0"  target="_blank" uc="true">{{att.FILENAME}}</a>
                        </div>
                    </td>
                </tr>
            </table>
            <a href="/Portal/ReadAttachment/ReadBatch?BizObjectID={{info.OBJECTID}}&SchemaCode={{attach[0].BIZOBJECTSCHEMACODE}}&DataField={{attach[0].DATAFIELD}}&DisplayName={{attach[0].DATAFIELD}}" style="width: 100%; border: 1px dashed rgb(221, 221, 221);">批量下载</a>
        </div>

    </div>


</div>
</body>

<script type="text/javascript" src="../js/header.js"></script>
<script>
    /*导入头部和尾部*/
    $(window).ready(function(){
        $(".header-nav").load("header.html");
    });

    //    $(".nav-li li").click(function () {
//        $(".nav-li li").eq($(this).index()).addClass("change-img").siblings().removeClass("change-img");
//    })

</script>
</body>
</html>